package com.amuse.amuse.mapper.user_login;

import com.amuse.amuse.entity.students;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.hibernate.annotations.Parameter;

@Mapper
public interface UserLoginDao {
    // 学生登录
    @Select("select * from students where studentId = #{studentId} and password = #{password}")
    public students studentLogin(@Param("studentId") Integer studentId, @Param("password") String password);

    //学生注册
    @Insert("insert into students(studentId,name,password,grade,className,courseType) values(#{studentId},#{name},#{password},#{grade},#{className},#{courseType})")
    public int studentRegister( @Param("studentId") Integer studentId, @Param("password") String password,  @Param("name") String name, @Param("className") String className,@Param("grade")  String grade,  @Param("courseType") String courseType);

    //获取密文
    @Select("select password from students where studentId = #{studentId}")
    public String getPassword(@Param("studentId") Integer studentId);
}
